{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "970be2f0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "0cf2b2ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "def xboundary(name,dim):\n",
    "    xrange = np.ones((dim,2));\n",
    "    if name in ['UF1','UF2','UF5','UF6','UF7','CF2']:\n",
    "        xrange[0,0]      =  0;\n",
    "        xrange[1:dim,0]  = -1;\n",
    "    if name == 'UF3':\n",
    "        xrange[:,1]      =  0;  \n",
    "    if name in ['UF4','CF3','CF4','CF5','CF6','CF7']:\n",
    "        xrange[1,1]      =  0;\n",
    "        xrange[2:dim,1]  = -2;\n",
    "        xrange[2:dim,2]  =  2; \n",
    "    if name in ['UF8','UF9','UF10','CF9','CF10']:\n",
    "        xrange[1:2,1]   =  0;\n",
    "        xrange[3:dim,1]  = -2;\n",
    "        xrange[3:dim,2]  =  2;   \n",
    "    if name == 'CF1':\n",
    "        xrange[:,1]      =  0; \n",
    "    if name == 'CF8':\n",
    "        xrange[1:2,1]    =  0;\n",
    "        xrange[3:dim,1]  = -4;\n",
    "        xrange[3:dim,2]  =  4;\n",
    "    return xrange"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "754cfdf6",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = xboundary('UF1',7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a9c69974",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.,  1.],\n",
       "       [-1.,  1.],\n",
       "       [-1.,  1.],\n",
       "       [-1.,  1.],\n",
       "       [-1.,  1.],\n",
       "       [-1.,  1.],\n",
       "       [-1.,  1.]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "842cf173",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
